const session = require('koa-session2')
const localStore = require('./session_store')
const SessionDB = require('../db/session')


const conf = {

    // cooike key
    key: 'wxRead_session',
    
    maxAge: 60000,
    
    store: new localStore(SessionDB)
    
}


function bindSession (app){
    app.use(session(conf))
}


module.exports = bindSession